<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .content {
        height: 300px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
      }
      .btn {
        height: 50px;
        width: 200px;
        align-items: center;
        margin: 5px;
        background-color: aqua;
      }
    </style>
  </head>
  <body>
    <div class="content">
      <button class="btn" onclick="btnClick()">Click1</button>
      <button class="btn" onclick="btnClick()">Click2</button>
    </div>
  </body>
  <script>
    const cartList = [
      {
        uid: 10001,
        goodsId: 1,
        goodsName: '60两件春秋圆环拉链上衣高领显瘦修身长袖打底衫T恤女针织毛衣',
        goodsPrice: 199,
        goodsNum: 3,
        goodsImgUrl: '/images/s-1.webp',
        checked: false,
      },
      {
        uid: 10001,
        goodsId: 4,
        goodsName: '2件60露背t恤女短袖新款夏修身针织衫上衣冰丝体恤微透打底衫',
        goodsPrice: 99,
        goodsNum: 2,
        goodsImgUrl: '/images/s-4.webp',
        checked: false,
      },
    ]
    const list = ['自行车', '汽车', '火车', '高铁', '轮船', '飞机', '滴滴']

    function btnClick() {
      let list = [
        {
          uid: 123,
          goodsName: 'goodsName123',
        },
        {
          uid: 456,
          goodsName: 'goodsName456',
        },
      ]
      const array = [1, 2, undefined, 4, 5, null]
      const result = list.map((item) => {
        item.goodsName = '商品'
        return item
      })
    }
  </script>
</html>
